<template>
	<view class="walletList">
		<HeaderBar title="选择转账代币" showBack backgroundColor="#F6F6F6" fixed />
		<view class="content">
			<view class="scroll-Y">
				<view class="scroll-view-item" v-for="(item,index) in choinInfo" :key="index" @tap="switchToken(item)">
					<view class="coin">
						<image :src="'/static/images/tokenicon/' +item.tokenaddress+item.chainType+item.chainId+'.png'" mode="widthFix" class="icon"></image>
					</view>
					<view class="coin_describe">
						<view class="left">
							{{item.tokensymbol}}
						</view>
						<view class="right">
							<view class="total">
								{{$utils.toTwoDecimalDown(item.tokennum)}}
								<!-- {{item.tokennum}} -->
							</view>
							<view class="total_u">
								≈ $0
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				addressList: []
			}
		},
		computed: {
			choinInfo() {
				return this.$store.getters.choinInfo
			},
		},
		methods: {
			switchToken(token) {
				uni.$emit("switchToken", token)
				uni.navigateBack();
			},
		}
	}
</script>

<style scoped lang="scss">
	.walletList {
		width: 100%;
		height: 100%;
		background: #F6F6F6;
		font-size: 26upx;

		.content {

			.scroll-Y {
				width: 100%;
				flex: 1;
				padding-left: 30upx;
				box-sizing: border-box;

				.scroll-view-item {
					display: flex;
					align-items: center;

					.coin {
						display: flex;
						margin-right: 14upx;

						.icon {
							width: 60upx;
							height: 60upx;
						}
					}

					.coin_describe {
						flex: 1;
						border-bottom: 1px solid #D8D8D8;
						display: flex;
						justify-content: space-between;
						align-items: center;
						padding: 20upx 40upx 20upx 8upx;
						color: #3D3D3D;
						font-weight: 400;

						.left {
							font-size: 36upx;
						}

						.right {
							display: flex;
							flex-direction: column;
							align-items: end;

							.total {
								font-size: 36upx;
							}

							.total_u {
								color: #A2A2A2;
								font-size: 24upx;
							}
						}
					}
				}
			}
		}
	}
</style>